﻿@model IEnumerable<GameSchoolApplication.Models.Game>

@{
    ViewBag.Title = "Mínir leikir";
    Layout = "~/Views/Shared/_TeacherMore.cshtml";
}

<div class="tabbed">
    <ul>
        @foreach (var game in Model) {
            <li><a href="#game-@game.GameId">@game.Title</a></li>
        }
    </ul>
    @foreach (var game in Model) {
        <div id="game-@game.GameId">
           <p>@game.Description</p>
           @Html.ActionLink("Uppsetning leiks", "Index", "Level", new { gameId = game.GameId }, new { @class="GameSetup"})
           @if (!game.IsOpen)
           {
               using (Html.BeginForm("OpenGame", "Game", new { id = game.GameId }))
               {
                    
                    <input type="submit" name="submit" value="Opna leik" />    
               }
           }
        </div>
    }
</div>


